package com.lin.data.jpa.model.other;

import com.lin.data.jpa.model.entity.SysUser;
import lombok.RequiredArgsConstructor;
import org.springframework.data.util.Streamable;

import java.util.Iterator;

/**
 * @author: linjiang
 * @date: 2025/2/16
 */
@RequiredArgsConstructor(staticName = "of")
public class Users implements Streamable<SysUser> {

    private final Streamable<SysUser> streamable;

    public Integer getId() {
        return streamable.stream()
                .map(SysUser::getId)
                .findFirst().get();
    }

    @Override
    public Iterator<SysUser> iterator() {
        return streamable.iterator();
    }


}
